//
//	ZcoModelRing.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelRing.h"

NSString *const kZcoModelRingInvitationId = @"invitationId";
NSString *const kZcoModelRingSession = @"session";
NSString *const kZcoModelRingUserData = @"userData";

@interface ZcoModelRing ()
@end
@implementation ZcoModelRing




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelRingInvitationId] isKindOfClass:[NSNull class]]){
		self.invitationId = dictionary[kZcoModelRingInvitationId];
	}	
	if(![dictionary[kZcoModelRingSession] isKindOfClass:[NSNull class]]){
		self.session = [[ZcoModelSession alloc] initWithDictionary:dictionary[kZcoModelRingSession]];
	}

	if(![dictionary[kZcoModelRingUserData] isKindOfClass:[NSNull class]]){
		self.userData = [[ZcoModelUserData alloc] initWithDictionary:dictionary[kZcoModelRingUserData]];
	}

	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.invitationId != nil){
		dictionary[kZcoModelRingInvitationId] = self.invitationId;
	}
	if(self.session != nil){
		dictionary[kZcoModelRingSession] = [self.session toDictionary];
	}
	if(self.userData != nil){
		dictionary[kZcoModelRingUserData] = [self.userData toDictionary];
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.invitationId != nil){
		[aCoder encodeObject:self.invitationId forKey:kZcoModelRingInvitationId];
	}
	if(self.session != nil){
		[aCoder encodeObject:self.session forKey:kZcoModelRingSession];
	}
	if(self.userData != nil){
		[aCoder encodeObject:self.userData forKey:kZcoModelRingUserData];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.invitationId = [aDecoder decodeObjectForKey:kZcoModelRingInvitationId];
	self.session = [aDecoder decodeObjectForKey:kZcoModelRingSession];
	self.userData = [aDecoder decodeObjectForKey:kZcoModelRingUserData];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelRing *copy = [ZcoModelRing new];

	copy.invitationId = [self.invitationId copy];
	copy.session = [self.session copy];
	copy.userData = [self.userData copy];

	return copy;
}
@end